﻿using _220105BookSys.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace _220105BookSys.IRepository
{
    public interface IBookTypeRepository
    {
        Task<IEnumerable<BookType>> GetBookTypesAsync();
        Task<IEnumerable<BookType>> GetBookTypesAsync(bool asc);
        Task<IEnumerable<BookType>> GetBookTypesAsync(int pageIndex,int pageSize=10);

        Task<IEnumerable<BookType>> GetBookTypesAsync(Expression<Func<BookType, bool>> expression);
        Task<IEnumerable<BookType>> GetBookTypesAsync(Expression<Func<BookType, bool>> expression,bool asc);
        Task<IEnumerable<BookType>> GetBookTypesAsync(Expression<Func<BookType, bool>> expression, bool asc,int pageIndex,int pageSize=10);






        Task<BookType> GetBookTypeAsync(Guid id);

        Task<int> GetTotalAsync();

        Task<bool> IsExsitedAsync(Guid id);

        Task<bool> CreateAsync(BookType BookType);

        Task<bool> UpdateAsync(BookType BookType);

        //Task FakeDeleteAsync(Guid id);  不用基类继承，或者没有使用IsRemoved属性修饰类时，无法使用假删除

        Task<bool> RealDeleteAsync(Guid id);

        Task<bool> SaveChangesAsync();

    }
}
